<script type="text/javascript">
	function passfield()
    {
        //alert('hey');
        $('#changepass').load('<?php echo $this->Html->url(array('controller' => 'users', 'action' => 'changepass'))?>');
    }
</script>

<div class="center" >
    <?php echo $form->create('User', array('action' => 'profile/'.$profile['User']['id'])); ?>
                <h3>Profile Information</h3>
                <hr />
                <!-- the tabs -->
                <div class="tabbed-pane">
                    <ul class="tabs">
                        <li><a href="#">User Information</a></li>
                        <li><a href="#">Assigned Skills</a></li>
                        <li><a href="#">Availability</a></li>
                        <li onclick="passfield()"><a href="#">Password Reset</a></li>
                        
                        
                    </ul>

                    <!-- tab "panes" -->
                    <div class="panes clearfix">
                        <section>
                        <fieldset class="form grid_6">
                            
                            <?php echo $form->input('User.email_address', array('value' => $profile['User']['email_address'], 'label' => 'Email Address/Login', 'Disabled' => 'Disabled'));?>
                            <?php echo $form->input('User.fname', array('label' => 'First Name', 'value' => $profile['User']['fname']));?>
                            <?php echo $form->input('User.lname', array('label' => 'Last Name', 'value' => $profile['User']['lname']));?>                                                        
                            <?php echo $form->input('User.hphone', array('label' => 'Home Phone', 'value' => $profile['User']['hphone']));?>
                            <?php echo $form->input('User.cphone', array('label' => 'Cell Phone', 'value' => $profile['User']['cphone']));?>
                            <?php echo $form->input('User.wphone', array('label' => 'Work Phone', 'value' => $profile['User']['wphone'])); ?>
                            <?php echo $form->input('User.id', array('value' => $profile['User']['id'], 'hidden' =>true)); ?>
                            
                        </fieldset>
                        </section>
                        <section>
                        <fieldset>
                          <label>To have your skills changed please speak with the volunteer staff at the ANA office.</label>  
                            <div id="skillwrapper">
                            <?php 
                                    //echo pr($selected);
                                    //$options = array();
//                                    
//                                    $selected = array();
//                                   $options['disabled'] = array('disabled' => true);
//                                    foreach($skill as $sk)
//                                    {
//                                       $options[$sk['Skill']['id']] = $sk['Skill']['name'];              
//                                    }
//                                    foreach ($profile['Skill'] as $sk)
//                                    {
//                                        $selected[] = $sk['id'];
//                                    }
//                                    echo $form->input('Skill', array('label' => '', 'multiple' => 'checkbox', 'options' => $options, 'selected' => $selected));
                                    foreach ($profile['Skill'] as $sk)
                                    {
                                        echo ' - ' . $sk['name'] . '<br/>';
                                    }
                                    
                            ?>
                            </div>
                        </fieldset>

                        </section>
                        <section>
                        <fieldset>
                            
                        <div id="availablewrapper">
                        <?php
                        $options = array();
                        $selected = array();
                        foreach($avail as $av)
                        {
                            $options[$av['Available']['id']] = $av['Available']['avail_day'] . ' ' . $av['Available']['avail_time'];
                        }
                        foreach ($profile['Available'] as $av)
                                    {
                                        $selected[] = $av['id'];
                                    }
                        echo $form->input('Available', array('label' => '', 'multiple' => 'checkbox', 'options' => $options, 'selected' => $selected));
                        ?>
                        </div>
                        </fieldset>
                        </section>
                        <section>
                        
                         <?php echo $form->button('Change Password', array('onclick' => 'location.href=\'' . $this->Html->url('/users/changepassword/'.$profile['User']['id']) . '\'' , 'type' => 'button')); ?>

                        </section>
                    </div>
                </div>
                
            </div>
            <section class="container_6 clearfix">
    
    </fieldset>
    
    <fieldset class="form grid_6">        
        <div >
        <?php echo $form->button('<span class="accept"></span>Save Profile', array('class' => 'button button-gray accept')); ?>
        <?php echo $form->end(); ?>
        </div>
    </fieldset>

    
        
    
    </fieldset>
    <!--</form>-->


</section>
<?php
//	pr($_SESSION);
?>
</div>